Now Available!

Native .Net
Components

TList WinForms
for
.Net Framework

&

MetaDraw WinForms
for
.Net Framework



Bennet-Tec
Components
Make you
look sharp!



Home

Company

Products

Order Forms

How To

Downloads

Updates

Support

Registration

Dependencies

Links

Compatibility

Site Map


Basic How To


How to format Font

View On-Line Sample
Return to main How To Page

FontBold Property

Description: Sets the current font to Bold. Any currently selected text is changed to bold. Other details remain unchanged.

Returns: TRUE or FALSE depending on current font is Bold or not. For a select region containing text of mixed bold and unbold characters this property returns ATX_UNDEFINED.

Syntax:

ALLText.FontBold = n%
n% = ALLText.FontBold

Access:
Read Write
Design - -
Run + +

DataType: Integer

Values:

True - current font is Bold.
False - current font is not Bold.
ATX_UNDEFINED - current font is undefined

Default: False

1:36 PM 9/9/2003Example:

Sub cmdBold_Click()

If ALLText.FontBold <> True then
 ALLText.FontBold = True
Else
 ALLText.FontBold = False
End If

End Sub

FontItalic Property

Description: Set current font Italic. Sets any currently selected text to Italic. Other details remain unchanged.

Returns: True or False depending on current font is Italic or not. For a select region containing a mixture of italic and non-italic text this property returns ATX_UNDEFINED.

Syntax:

ALLText.FontItalic = n%
n% = ALLText.FontItalic

Access:
Read Write
Design - -
Run + +

DataType: Integer

Values:

True - current font is Italic,
False - current font is not Italic.
ATX_UNDEFINED - current font is undefined.

Default: False

Example:

Sub cmdItalic_Click()

If ALLText.FontItalic <> True then
 ALLText.FontItalic = True
Else
 ALLText.FontItalic = False
End If

End Sub

FontUnder Property

Description: Sets or returns the underline style at the current caret position or selected text region. ALLText supports a very flexible underlining scheme whereby various styles of underlining may be set (Color, single or double, solid, dashed or dotted).

Note that settings of True/False may be used for the simple case of a single black underline. More complex styles are associated with other values. ALLText API Methods, MakeUnderline and GetUnderline have been provided to handle such values.

Syntax:

n% = ALLText.FontUnder
ALLText.FontUnder = n%
x% = ALLText.GetUnderline(ALLText.FontUnder, shape%, dblflag%, ncolor%)
ALLText.FontUnder = ALLText.MakeUnderline(shape%, dblflag%, ncolor%)

Access:
Read Write
Design - -
Run + +

DataType: Integer

Values: Defined by value set returned by make_underline function.

True - corresponds to a single black solid underline.
False - corresponds to no underlining.

Default: 0 - FALSE

NOTE: If Out of Range VB Overflow error, property value remains unchanged.

Example:

Sub cmdUnder_Click()

If ALLText.FontUnder <> True then
 ALLText.FontUnder = True
Else
 ALLText.FontUnder = False
End If

End Sub

FontStrike Property

Description: Sets current font to Strikethrough. Strikes-through any currently selected text.

Returns: True or False depending on current font is Strikethrough or not. If some text is selected and its font is either not set, or of mixed character, this property returns ATX_UNDEFINED.

Syntax:

ALLText.FontStrike = n%
n% = ALLText.FontStrike

Access:
Read Write
Design - -
Run + +

DataType: Integer

Values:

True - current font is Strikethrough.
False - current font is not Strikethrough.
ATX_UNDEFINED - current font is undefined

Default: False

Example:

Sub cmdStrike_Click()

If ALLText.FontStrike <> True then
 ALLText.FontStrike = True
Else
 ALLText.FontStrike = False
End If

End Sub

FontShadow Property

Description: Sets or returns the Shadowing characteristics (as an integer value) for text at the current caret position or within a selected text region. ALLText supports a unique shadow characteristic echoing up to two copies of a character, each offset by some distance (to the upper left and lower right of the base positioning) and each with a different color.

Manipulation of the shadowing requires use of API Methods MakeShadow and GetShadow. A value of FALSE may however be readily used as indicating the absense of shadowing. Likewise reading a value of ATX_UNDEFINED indicates a select region with mixed shadowing characteristics.

Syntax:

ALLText.FontShadow= n%
n% = ALLText.FontShadow

Access:
Read Write
Design - -
Run + +

DataType: Integer

Values: Specially organized values are used to define the shadowing. False indicates no shadowing, Other values may be composed or interpreted using the MakeShadow and GetShadow methods.

Default: False

Example:

Sub cmdShadow_Click()

If ALLText.FontShadow = False Then
  ALLText.FontShadow = ALLText.MakeShadow(1, 1, 0, 15)
Else
  ALLText.FontShadow = False
End If

End Sub

FontColor Property

Description: Set or returns the foreground color for a select region or the current cursor position. Other details remain unchanged. Returns ATX_COLOR_UNDEFINED for regions with mixed color settings.

Syntax:

ALLText.FontColor = c&
c& = ALLText.FontColor

Access:
Read Write
Design - -
Run + +

DataType: Long (RGBcolor)

Values: QBcolor(0) through QBcolor(15) or ATX_UNDEFINED

Examples:

Sub cmdFontColor1_Click()

ALLText1.FontColor = QBColor(1)

End Sub

<=========== or ============>

Sub cmdFontColor2_Click()

'Create font color dialog box, to change font color
CommonDialog1.Flags = cdlCCRGBInit
CommonDialog1.Color = ALLText.FontColor
CommonDialog1.ShowColor
ALLText.FontColor = CommonDialog1.Color

End Sub

Remarks: If you use VB 3.0 You can also manipulate colors using the constants specified in file CONSTANT.TXT. Otherwise the ATX constants are defined in the constants declaration file shipped with ALLText.


Copyright© 2003 Bennet-Tec Information Systems, Inc. All rights reserved.